package com.qf.fc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.fc.dao.UserLogDao;
import com.qf.fc.entity.UserLog;
import com.qf.fc.service.UserLogService;
import com.qf.fc.vo.R;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户日志表(UserLog)表服务实现类
 *
 * @author makejava
 * @since 2024-09-16 22:56:04
 */
@Service("userLogService")
@RequiredArgsConstructor
public class UserLogServiceImpl implements UserLogService {


    private final UserLogDao logDao;
    @Override
    public R<List<UserLog>> queryUid(Integer uid) {
        LambdaQueryWrapper<UserLog> wrapper = new LambdaQueryWrapper<>();
        if(uid!=null && uid>0){
            wrapper.eq(UserLog::getUid,uid);
        }
        wrapper.orderByDesc(UserLog::getCreateTime);
        return R.ok(logDao.selectList(wrapper));
    }
}

